import request from '../../utils/httpRequest'

const categorybrandrelation = '/product/product/categorybrandrelation'

// 查询list
export function getCategoryBrandRelationCatelogList (params) {
  return request({
    url: `${categorybrandrelation}/catelog/list`,
    method: 'get',
    params: params
  })
}

// 根据分类id查询商品集合
export function getBrandsByCatelogId (id) {
  return request({
    url: `${categorybrandrelation}/brands/list?catId=${id}`,
    method: 'get',
  })
}

// 根据ids批量删除
export function deleteCategoryBrandRelationByIds (data) {
  return request({
    url: `${categorybrandrelation}/delete`,
    method: 'delete',
    data
  })
}

// 根据id查询
export function getCategoryBrandRelationById (id) {
  return request({
    url: `${categorybrandrelation}/info/${id}`,
    method: 'get'
  })
}

// 新增
export function saveCategoryBrandRelation (data) {
  return request({
    url: `${categorybrandrelation}/save`,
    method: 'post',
    data
  })
}

// 修改
export function updateCategoryBrandRelation (data) {
  return request({
    url: `${categorybrandrelation}/update`,
    method: 'put',
    data
  })
}
